/* ============================================================
   HIEROGLYPHS WEB — style.css
   Theme: Ancient Egyptian — warm papyrus, gold, stone
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    --papyrus:       #f5e6c8;
    --papyrus-dark:  #e8d5a3;
    --stone:         #c8b89a;
    --stone-dark:    #a0896b;
    --gold:          #c9922a;
    --gold-light:    #e8b84b;
    --gold-pale:     #f5dfa0;
    --ink:           #2c1f0e;
    --ink-light:     #4a3520;
    --sand:          #d4c098;
    --red-accent:    #8b2500;
    --white:         #fdfaf3;
    --shadow:        rgba(44, 31, 14, 0.35);

    --font-title:    'Cinzel', serif;
    --font-body:     'IM Fell English', serif;

    --radius:        4px;
    --transition:    0.3s ease;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    scroll-behavior: smooth;
}

body {
    background-color: var(--sand);
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(160, 137, 107, 0.08) 0px,
            rgba(160, 137, 107, 0.08) 1px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(160, 137, 107, 0.08) 0px,
            rgba(160, 137, 107, 0.08) 1px,
            transparent 1px,
            transparent 60px
        );
    font-family: var(--font-body);
    color: var(--ink);
    line-height: 1.8;
    padding: 0 0 60px 0;
}

/* ============================================================
   3. HEADER
   ============================================================ */
.main-header {
    background: linear-gradient(160deg, var(--ink) 0%, #1a0f05 60%, #3a2510 100%);
    color: var(--gold-light);
    text-align: center;
    padding: 48px 20px 40px;
    border-bottom: 6px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 28px,
        rgba(201, 146, 42, 0.04) 28px,
        rgba(201, 146, 42, 0.04) 29px
    );
    pointer-events: none;
}

.header-deco {
    font-size: 2.2rem;
    color: var(--gold);
    opacity: 0.6;
    letter-spacing: 0.3em;
    margin-bottom: 8px;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 0.9; }
}

.site-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--gold-light);
    text-shadow: 0 2px 12px rgba(232, 184, 75, 0.4), 0 0 40px rgba(232, 184, 75, 0.15);
    margin: 12px 0 10px;
    animation: fadeDown 0.7s ease both;
}

.site-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--stone);
    letter-spacing: 0.08em;
    animation: fadeDown 0.7s 0.15s ease both;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   4. INTRO SECTION
   ============================================================ */
.intro-section {
    text-align: center;
    max-width: 820px;
    margin: 48px auto 20px;
    padding: 0 24px;
}

.intro-text {
    font-size: 1.08rem;
    color: var(--ink-light);
    line-height: 1.9;
    background: var(--white);
    border: 2px solid var(--stone-dark);
    border-left: 6px solid var(--gold);
    border-radius: var(--radius);
    padding: 24px 32px;
    box-shadow: 4px 4px 0 var(--stone-dark);
}

mark {
    background-color: var(--ink);
    color: var(--gold-light);
    padding: 2px 7px;
    border-radius: 2px;
    font-weight: bold;
}

/* ============================================================
   5. NAVIGATION
   ============================================================ */
.page-nav {
    margin: 30px 0 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.page-nav strong {
    width: 100%;
    display: block;
    font-family: var(--font-title);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--stone-dark);
    margin-bottom: 4px;
}

.page-nav a {
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 10px 20px;
    border: 2px solid var(--ink);
    background: var(--papyrus);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition),
                transform var(--transition), box-shadow var(--transition);
    box-shadow: 3px 3px 0 var(--ink);
}

.page-nav a:hover {
    background-color: var(--ink);
    color: var(--gold-light);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--gold);
}

/* ============================================================
   6. SEARCH
   ============================================================ */
.search-container {
    margin: 28px auto 0;
    max-width: 460px;
}

.search-label {
    display: block;
    font-family: var(--font-title);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--stone-dark);
    margin-bottom: 8px;
}

#glyphSearch {
    padding: 13px 18px;
    width: 100%;
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--white);
    color: var(--ink);
    outline: none;
    box-shadow: 4px 4px 0 var(--stone-dark);
    transition: box-shadow var(--transition), border-color var(--transition);
}

#glyphSearch:focus {
    border-color: var(--gold);
    box-shadow: 4px 4px 0 var(--gold);
}

#glyphSearch::placeholder {
    color: var(--stone-dark);
    font-style: italic;
}

.search-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--stone-dark);
    font-style: italic;
    min-height: 1.2em;
}

/* ============================================================
   7. GLYPH SECTIONS
   ============================================================ */
.glyph-section {
    max-width: 960px;
    margin: 60px auto 0;
    padding: 0 24px;
    animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--gold);
}

.section-glyph {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px var(--shadow));
}

.glyph-section h2 {
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.05em;
}

.part-tag {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--gold);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 50px;
    vertical-align: middle;
    margin-left: 8px;
    font-weight: 400;
}

.section-desc {
    font-style: italic;
    color: var(--stone-dark);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ============================================================
   8. TABLE
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--papyrus);
    border: 4px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 8px 8px 0 var(--ink);
    overflow: hidden;
}

table th {
    background: var(--ink);
    color: var(--gold-light);
    font-family: var(--font-title);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 16px 20px;
    text-align: center;
    border-bottom: 3px solid var(--gold);
    font-weight: 700;
}

table td {
    padding: 14px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--papyrus-dark);
    color: var(--ink-light);
    transition: background var(--transition), color var(--transition);
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover td {
    background: var(--gold-pale);
    color: var(--ink);
}

table tbody tr:nth-child(even) td {
    background: var(--papyrus-dark);
}

table tbody tr:nth-child(even):hover td {
    background: var(--gold-pale);
}

.hieroglyph {
    font-size: 34px;
    line-height: 1.2;
    background: var(--white) !important;
    color: var(--ink);
    padding: 10px 16px;
    border-radius: 2px;
    border: 1px solid var(--stone);
    filter: drop-shadow(1px 1px 2px rgba(44,31,14,0.15));
}

/* Arabic text */
td[lang="ar"] {
    font-size: 1.3rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    color: var(--red-accent);
    font-weight: 700;
}

/* ============================================================
   9. FOOTER
   ============================================================ */
.main-footer {
    background: var(--ink);
    color: var(--stone);
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    border-top: 6px solid var(--gold);
}

.footer-deco {
    font-size: 1.6rem;
    color: var(--gold);
    letter-spacing: 0.4em;
    margin-bottom: 16px;
    opacity: 0.6;
}

.footer-credit {
    font-family: var(--font-title);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--papyrus);
    margin-bottom: 8px;
}

.footer-credit mark {
    background: var(--gold);
    color: var(--ink);
    padding: 2px 10px;
    border-radius: 2px;
}

.footer-note {
    font-style: italic;
    font-size: 0.82rem;
    color: var(--stone-dark);
    margin-top: 6px;
}

/* ============================================================
   10. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: var(--sand); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--stone-dark); }

/* ============================================================
   11. MOBILE RESPONSIVENESS
   ============================================================ */
@media screen and (max-width: 640px) {
    .main-header {
        padding: 36px 16px 28px;
    }

    .intro-text {
        padding: 18px 20px;
        font-size: 0.95rem;
    }

    .page-nav a {
        width: 100%;
        text-align: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    table th, table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .hieroglyph {
        font-size: 26px;
    }

    td[lang="ar"] {
        font-size: 1.1rem;
    }

    .glyph-section {
        padding: 0 14px;
    }
}

@media screen and (max-width: 400px) {
    .site-title {
        letter-spacing: 0.06em;
    }

    .hieroglyph {
        font-size: 22px;
    }
}